#pragma once

#include <iostream>

namespace Log
{
    class LogLevel
    {
    public:
        enum class value // c++11 引进的更安全的枚举
        {   
            UNKNOW = 0,
            DEBUG, // DRBUG 进⾏debug时候打印⽇志的等级
            INFO,      // INFO 打印⼀些⽤⼾提⽰信息
            WARN,      // WARN 打印警告信息
            ERROR,     // ERROR 打印错误信息
            FATAL,     // FATAL 打印致命信息- 导致程序崩溃的信息
            OFF        // OFF 关闭所有⽇志输出

        };

        static const char *tostring(LogLevel::value level)
        {
            switch (level)
            {
            case LogLevel::value::DEBUG:
                return "DEBUG";
            case LogLevel::value::INFO:
                return "INFO";
            case LogLevel::value::WARN:
                return "WARN";
            case LogLevel::value::ERROR:
                return "ERROR";
            case LogLevel::value::FATAL:
                return "FATAL";
            case LogLevel::value::OFF:
                return "OFF";
            default:
                return "UNKNOW";
            }

            return "UNKNOW";
        }
    };
}